package com.sgb.kjwl.view.ui.activity.transport;

import android.content.Context;
import android.content.Intent;

import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.sgb.kjwl.AppActivity;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ActivityDriverLookForGoodsBinding;
import com.sgb.kjwl.view.ui.fragment.home.FindCarMapAndListFragment;

public class DriverLookForGoodsActivity extends AppActivity {

    ActivityDriverLookForGoodsBinding binding;

    public static void start(Context context) {
        Intent intent = new Intent();
        intent.setClass(context, DriverLookForGoodsActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        context.startActivity(intent);
    }

    @Override
    protected void initView() {
        binding = DataBindingUtil.setContentView(this, R.layout.activity_driver_look_for_goods);


        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction beginTransaction = manager.beginTransaction();
        beginTransaction.add(R.id.fragment, FindCarMapAndListFragment.newInstance("", true));
        beginTransaction.commit();
    }

    @Override
    protected void init() {
        binding.title.titleView.setText("司机找货");
        binding.title.ivBack.setOnClickListener(v -> finish());
    }
}
